#include<bits/stdc++.h>

using namespace std;

int main() {
	int x, y, z;
	for (x = 123; 3 * x <= 987; x++) {
		y = 2 * x;
		z = 3 * x;
		char s[100];
		sprintf(s, "%d%d%d", x, y, z);
		sort(s, s + 9);
		if (strcmp(s, "123456789") == 0)
			cout << x << " " << y << " " << z << endl;
	}
    return 0;
} 
